package com.vma.manageSystem.controller;

import com.jfinal.core.Controller;
import com.vma.lottery.model.Predict;
import com.vma.manageSystem.util.ReturnsUtil;

/**
 * Created by chenzui on 2017/3/29.
 */
public class LotteryController extends Controller {

    public void getPredict(){
        Predict predict = Predict.dao.findFirst("select * from predict order by id desc");
        renderJson(ReturnsUtil.returnSuccess(predict));
    }

//    var code;
//    var shengxiao;
//    var leftCode;
//    var wuxing;
//    var bose;
    public void add(){
        String code = getPara("code");
        String shengxiao = getPara("shengxiao");
        String leftCode = getPara("leftCode");
        String wuxing = getPara("wuxing");
        String bose = getPara("bose");
        new Predict().setCode(code).setShengxiao(shengxiao).setLeftCode(leftCode)
                .setWuxing(wuxing).setBose(bose).save();
        renderJson(ReturnsUtil.returnSuccess("成功"));

    }
}
